package cn.fscode.code.generator.model.po;


import cn.fscode.code.generator.annotation.Excel;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 模板表
 * @author shenguangyang
 */
@Getter
@Setter
@ToString
@TableName("template_config")
public class TemplateConfigPO implements IBasePO {
    @TableId
    @Excel(name = "模板序号", sort = 1, cellType = Excel.ColumnType.STRING, prompt = "模板编号")
    private Long id;

    @NotNull(message = "不能为空")
    @Excel(name = "模板组", sort = 2, cellType = Excel.ColumnType.STRING)
    private Long groupId;

    private String groupName;

    /** 模板名称 */
    @NotEmpty(message = "不能为空")
    @Excel(name = "模板名称", sort = 3)
    private String name;

    /**
     * 目录
     */
    @Excel(name = "目录", sort = 4)
    private String folder;

    /** 文件名称 */
    @NotEmpty(message = "不能为空")
    @Excel(name = "文件名称", width = 50, sort = 4)
    private String fileName;

    /** 内容 */
    @NotEmpty(message = "不能为空")
    @Excel(name = "模板内容", width = 100, sort = 8)
    private String content;

    /** 是否删除，1：已删除，0：未删除 */
    @Excel(name = "是否被删除", sort = 5)
    private Integer isDeleted;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Excel(name = "更新时间", width = 30, sort = 6, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @TableField(fill = FieldFill.INSERT)
    @Excel(name = "创建时间", width = 30, sort = 7, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
}
